package Thread;

/**
 * Created with IntelliJ IDEA.
 * Description: 获取线程引用测试
 */
public class ThreadDemo12 {
    public static void main(String[] args) {
        Thread t = new Thread(){
            @Override
            public void run() {
                //this只能是在继承Thread类这种创建进程的方法中才能使用
                //System.out.println(this.getName());
                System.out.println(Thread.currentThread());
                System.out.println(Thread.currentThread().getName());
            }
        };
        t.start();
    }
}
